package com.briup.cms.service.impl;

import com.briup.cms.bean.Inform;

import com.briup.cms.dao.InformMapper;

import com.briup.cms.service.IInformService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class InformServiceImpl implements IInformService {
    @Resource
    private InformMapper informMapper;

    @Override
    public List<Inform> findAll() {
        return informMapper.selectAll();
    }
    @Override
    public void saveOrUpdate(Inform inform) {
        if(inform.getId()!=null){
            informMapper.update(inform);
        } else {
            informMapper.insert(inform);
        }
    }

    @Override
    public void deleteById(long id) {
        informMapper.deleteById(id);
    }
}
